From: Marco Trevisan (TreviƱo) Date: Mon, 16 Feb 2026 21:11:28 +0000 (+0100) Subject: search: Do not check for class cancellable state after awaiting X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~28^2~4^2^2~26 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3722d1812e57da64421b3629a9e4cf8b2aebff80;p=gnome-shell.git search: Do not check for class cancellable state after awaiting In an async function, after awaiting, the cancelled state for the class-tracked cancellable may not respect the actual state of the cancellable that has been used to perform the call. Thus, let's use a local variable instead Part-of: (cherry picked from commit c55a07df6b498adb3c570d22f0024d16fc052b41) --- diff --git a/js/ui/search.js b/js/ui/search.js index ac5401566..1139cbfde 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -225,11 +225,12 @@ const SearchResultsBase = GObject.registerClass({ return; this._cancellable.cancel(); - this._cancellable = new Gio.Cancellable(); + const cancellable = new Gio.Cancellable(); + this._cancellable = cancellable; - const metas = await this.provider.getResultMetas(metasNeeded, this._cancellable); + const metas = await this.provider.getResultMetas(metasNeeded, cancellable); - if (this._cancellable.is_cancelled()) { + if (cancellable.is_cancelled()) { if (metas.length > 0) throw new Error(`Search provider ${this.provider.id} returned results after the request was canceled`); }